home *** CD-ROM | disk | FTP | other *** search
/ Practical Internet 2002 November / Practical Internet November 2002.iso / pc / Software / Workshops / gg_setup.exe / #setuppath# / ggcss.exe / enc.asp < prev    next >
Encoding:
Text File  |  2002-01-08  |  5.4 KB  |  227 lines

  1. <%@LANGUAGE="VBSCRIPT"%>
  2. <!-- #include file="connex.asp" -->
  3. <%
  4. set rsConfig = Server.CreateObject("ADODB.Recordset")
  5. rsConfig.ActiveConnection = connex
  6. rsConfig.Source = "SELECT * FROM CONFIG"
  7. rsConfig.CursorType = 0
  8. rsConfig.CursorLocation = 2
  9. rsConfig.LockType = 3
  10. rsConfig.Open()
  11. rsConfig_numRows = 0
  12. %>
  13. <%
  14. REDIR="login.asp"
  15. 'On Error Resume Next
  16. REG_KEY=Request.Form("REG_KEY")
  17. If REG_KEY="" Then
  18. Response.Redirect(REDIR)
  19. Else
  20. REG_KEY=REG_KEY
  21. End If
  22. FRST_NAME=Request.Form("FRST_NAME")
  23. If Len(FRST_NAME) < 2 Then
  24. Response.Redirect("login.asp")
  25. Else
  26. FRST_NAME=FRST_NAME
  27. End If
  28. LST_NAME=Request.Form("LST_NAME")
  29. If Len(LST_NAME) < 2 Then
  30. Response.Redirect(REDIR)
  31. Else
  32. LST_NAME=LST_NAME
  33. End If
  34. FULL_NME=LST_NAME&FRST_NAME
  35. NME=StrReverse(UCase(FULL_NME))
  36. NUM=Len(NME)
  37. Set LetrChk = NEW RegExp
  38. LetrChk.Pattern = "A" 
  39. LetrChk.Global = True
  40. S1 = LetrChk.Replace(NME, "18"*NUM)
  41. SET LetrChk=Nothing
  42. Set LetrChk = NEW RegExp
  43. LetrChk.Pattern = "B" 
  44. LetrChk.Global = True
  45. S2 = LetrChk.Replace(S1, "26"*NUM)
  46. SET LetrChk=Nothing
  47. Set LetrChk = NEW RegExp
  48. LetrChk.Pattern = "C" 
  49. LetrChk.Global = True
  50. S3 = LetrChk.Replace(S2, "62"*NUM)
  51. SET LetrChk=Nothing
  52. Set LetrChk = NEW RegExp
  53. LetrChk.Pattern = "D" 
  54. LetrChk.Global = True
  55. S4 = LetrChk.Replace(S3, "444"*NUM)
  56. SET LetrChk=Nothing
  57. Set LetrChk = NEW RegExp
  58. LetrChk.Pattern = "E" 
  59. LetrChk.Global = True
  60. S5 = LetrChk.Replace(S4, "22"*NUM)
  61. SET LetrChk=Nothing
  62. Set LetrChk = NEW RegExp
  63. LetrChk.Pattern = "F" 
  64. LetrChk.Global = True
  65. S6 = LetrChk.Replace(S5, "64"*NUM)
  66. SET LetrChk=Nothing
  67. Set LetrChk = NEW RegExp
  68. LetrChk.Pattern = "G" 
  69. LetrChk.Global = True
  70. S7 = LetrChk.Replace(S6, "280"*NUM)
  71. SET LetrChk=Nothing
  72. Set LetrChk = NEW RegExp
  73. LetrChk.Pattern = "H" 
  74. LetrChk.Global = True
  75. S8 = LetrChk.Replace(S7, "668"*NUM)
  76. SET LetrChk=Nothing
  77. Set LetrChk = NEW RegExp
  78. LetrChk.Pattern = "I" 
  79. LetrChk.Global = True
  80. S9 = LetrChk.Replace(S8, "204"*NUM)
  81. SET LetrChk=Nothing
  82. Set LetrChk = NEW RegExp
  83. LetrChk.Pattern = "J" 
  84. LetrChk.Global = True
  85. S10 = LetrChk.Replace(S9, "842"*NUM)
  86. SET LetrChk=Nothing
  87. Set LetrChk = NEW RegExp
  88. LetrChk.Pattern = "K" 
  89. LetrChk.Global = True
  90. S11 = LetrChk.Replace(S10, "864"*NUM)
  91. SET LetrChk=Nothing
  92. Set LetrChk = NEW RegExp
  93. LetrChk.Pattern = "L" 
  94. LetrChk.Global = True
  95. S12 = LetrChk.Replace(S11, "324"*NUM)
  96. SET LetrChk=Nothing
  97. Set LetrChk = NEW RegExp
  98. LetrChk.Pattern = "M" 
  99. LetrChk.Global = True
  100. S13 = LetrChk.Replace(S12, "226"*NUM)
  101. SET LetrChk=Nothing
  102. Set LetrChk = NEW RegExp
  103. LetrChk.Pattern = "N" 
  104. LetrChk.Global = True
  105. S14 = LetrChk.Replace(S13, "861"*NUM)
  106. SET LetrChk=Nothing
  107. Set LetrChk = NEW RegExp
  108. LetrChk.Pattern = "O" 
  109. LetrChk.Global = True
  110. S15 = LetrChk.Replace(S14, "604"*NUM)
  111. SET LetrChk=Nothing
  112. Set LetrChk = NEW RegExp
  113. LetrChk.Pattern = "P" 
  114. LetrChk.Global = True
  115. S16 = LetrChk.Replace(S15, "60"*NUM)
  116. SET LetrChk=Nothing
  117. Set LetrChk = NEW RegExp
  118. LetrChk.Pattern = "Q" 
  119. LetrChk.Global = True
  120. S17 = LetrChk.Replace(S16, "86"*NUM)
  121. SET LetrChk=Nothing
  122. Set LetrChk = NEW RegExp
  123. LetrChk.Pattern = "R" 
  124. LetrChk.Global = True
  125. S18 = LetrChk.Replace(S17, "680"*NUM)
  126. SET LetrChk=Nothing
  127. Set LetrChk = NEW RegExp
  128. LetrChk.Pattern = "S" 
  129. LetrChk.Global = True
  130. S19 = LetrChk.Replace(S18, "246"*NUM)
  131. SET LetrChk=Nothing
  132. Set LetrChk = NEW RegExp
  133. LetrChk.Pattern = "T" 
  134. LetrChk.Global = True
  135. S20 = LetrChk.Replace(S19, "482"*NUM)
  136. SET LetrChk=Nothing
  137. Set LetrChk = NEW RegExp
  138. LetrChk.Pattern = "U" 
  139. LetrChk.Global = True
  140. S21 = LetrChk.Replace(S20, "44"*NUM)
  141. SET LetrChk=Nothing
  142. Set LetrChk = NEW RegExp
  143. LetrChk.Pattern = "V" 
  144. LetrChk.Global = True
  145. S22 = LetrChk.Replace(S21, "642"*NUM)
  146. SET LetrChk=Nothing
  147. Set LetrChk = NEW RegExp
  148. LetrChk.Pattern = "W" 
  149. LetrChk.Global = True
  150. S23 = LetrChk.Replace(S22, "668"*NUM)
  151. SET LetrChk=Nothing
  152. Set LetrChk = NEW RegExp
  153. LetrChk.Pattern = "X" 
  154. LetrChk.Global = True
  155. S24 = LetrChk.Replace(S23, "884"*NUM)
  156. SET LetrChk=Nothing
  157. Set LetrChk = NEW RegExp
  158. LetrChk.Pattern = "Y" 
  159. LetrChk.Global = True
  160. S25 = LetrChk.Replace(S24, "208"*NUM)
  161. SET LetrChk=Nothing
  162. Set LetrChk = NEW RegExp
  163. LetrChk.Pattern = "Z" 
  164. LetrChk.Global = True
  165. OUTPUT = LetrChk.Replace(S25, "820"*NUM)
  166. SET LetrChk=Nothing
  167. KEYLEN=Len(OUTPUT)
  168. If KEYLEN<20 Then
  169. KEYLEN=Len(OUTPUT)*2
  170. Else
  171. KEYLEN=KEYLEN
  172. End If
  173. If KEYLEN>40 Then
  174. KEYLEN=40
  175. Else
  176. KEYLEN=KEYLEN
  177. End If
  178. DIVKEY=KEYLEN/4
  179. KEYNUMA=Round(DIVKEY)
  180. KEYNUM=KEYNUMA-1
  181. SET1=Left(OUTPUT, KEYNUM)
  182. SET2A=Left(OUTPUT, KEYNUM*2)
  183. SET2=Right(SET2A, KEYNUM)
  184. SET3A=Left(OUTPUT, KEYNUM*3)
  185. SET3=Right(SET3A, KEYNUM)
  186. SET4A=Left(OUTPUT, KEYNUM*4)
  187. SET4=Right(SET4A, KEYNUM)
  188. STATICKEY=SET1&"-"&SET2&"-"&SET3&"-"&SET4
  189. KEYCHECK=StrComp(STATICKEY, REG_KEY, VBBinaryCompare)
  190. If KEYCHECK<>0 Then
  191. Response.Redirect(REDIR)
  192. Else If KEYCHECK=0 Then
  193. REG_DATE=rsConfig.Fields.Item("DATE_REGED").Value
  194. EXP_DATE=rsConfig.Fields.Item("DATE_EXPED").Value
  195. If REG_DATE = "1" Then
  196. TODAY=Date
  197. EXPIRATION=Date + 30
  198. Else
  199. TODAY=REG_DATE
  200. EXPIRATION=EXP_DATE
  201. End If
  202. Response.Write TODAY
  203. Response.Write " "
  204. Response.Write EXPIRATION
  205.  
  206. DB = connex
  207. Set rsCss = Server.CreateObject("ADODB.Recordset")
  208. rsCss.Open "CONFIG", DB, 1, 2
  209. rsCss("USR_KEY") = REG_KEY
  210. rsCss("F_NAME") = FRST_NAME
  211. rsCss("L_NAME") = LST_NAME
  212. rsCss("DATE_REGED") = TODAY
  213. rsCss("DATE_EXPED") = EXPIRATION
  214. rsCss.Update
  215. rsCss.Close
  216. Set rsCss = Nothing
  217. Response.Redirect("about.asp")
  218.  
  219. End If
  220. End If
  221. 'If Err <> 0 Then
  222. 'Response.Redirect("REDIR")
  223. 'End If
  224. %>
  225. <%
  226. rsConfig.Close()
  227. %>